<!-- 导航URL -->
<div class="row wrapper border-bottom white-bg page-heading">
	<div class="col-md-12">
		<ol class="breadcrumb">
			<li><a>主页</a></li>
			<li><a>管理中心</a></li>
			<li class="active"><strong>推送管理</strong></li>
		</ol>
	</div>
</div>
<!-- 主要内容 -->
<div class="wrapper wrapper-content animated fadeIn" ng-app
	ng-controller="pushManagerCtrl">
	<form class="form-horizontal" id="form1">
		<div class="row">
			<div class="col-lg-12">
				<div class="panel-body ibox float-e-margins">
					<div class="ibox-title">
						<h5>推送管理条件查询</h5>
					</div>
					<div class="ibox-content">
						<div class="form-group">
							<label class="col-sm-2 control-label">推送内容：</label>
							<div class="col-sm-2">
								<input type="text" class="form-control"
									ng-model='baseInfo.pushContent'/>
							</div>
							<label class="col-sm-2 control-label">跳转链接：</label>
							<div class="col-sm-2">
								<input type="text" class="form-control"
									   ng-model='jumpUrlEncode'/>
							</div>
							
							<label class="col-sm-2 control-label">移动端类型：</label>
							<div class="col-sm-2">
								<select class="form-control" ng-model="baseInfo.mobileTerminalType" ng-options="x.value as x.text for x in mobileTypeArr"/>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">推送对象：</label>
							<div class="col-sm-2">
								<select class="form-control" ng-model="baseInfo.pushObj" ng-options="x.value as x.text for x in pushObjArr"/>
							</div>
							<label class="col-sm-2 control-label">推送时间：</label>
							<div class="col-sm-6">

								<input id="d5366" class="form-control" type="datetime" ng-model="baseInfo.pushTimeBegin" onchange=""  style="width:auto;display:inline-block;"
											 onFocus="var d5367=$dp.$('d5367');WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss',onpicked:function(){d5367.focus();},maxDate:'#F{$dp.$D(\'d5367\')}'})"/>
								~
								<input id="d5367" class="form-control" type="datetime"  ng-model="baseInfo.pushTimeEnd" onchange=""  style="width:auto;display:inline-block;"
											 onFocus="WdatePicker({skin:'whyGreen',dateFmt: 'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'d5366\')}'})"/>
							</div>
						</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">推送状态：</label>
								<div class="col-sm-2">
									<select class="form-control" ng-model='baseInfo.pushStatus'
													ng-options="x.value as x.text for x in pushStatusArr">
									</select>
								</div>

								<label class="col-sm-2 control-label">创建时间：</label>
								<div class="col-sm-6">

									<input id="d53667" class="form-control" type="datetime" ng-model="baseInfo.createTimeBegin" onchange=""  style="width:auto;display:inline-block;"
												 onFocus="var d5367=$dp.$('d53678');WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss',onpicked:function(){d53678.focus();},maxDate:'#F{$dp.$D(\'d53678\')}'})"/>
									~
									<input id="d53678" class="form-control" type="datetime"  ng-model="baseInfo.createTimeEnd" onchange=""  style="width:auto;display:inline-block;"
												 onFocus="WdatePicker({skin:'whyGreen',dateFmt: 'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'d53667\')}'})"/>
								</div>
							</div>
						<div class="form-group">
							<label class="col-sm-2"></label>
							<div class="col-sm-10">
								<button class="btn btn-primary6 btn-mr20" type="button" ng-click='query()'>查询</button>
								<button class="btn btn-primary3 btn-mr20" type="button" ng-click="resetForm()">清空</button>
								<a class="btn btn-primary5 btn-mr20" target="_blank" ng-show="hasPermit('pushManager.saveOrUpdatePushManager')" type="button" ui-sref="sys.addPushManager">新增</a>
								<button class="btn btn-primary6 btn-mr20" type="button" ng-click='exportInfo()'>导出</button>
							</div>
						</div>

						</div>
					</div>
				</div>

				<div class="panel-body ibox float-e-margins">
					<div class="ibox-title">
						<h5>推送内容列表</h5>
					</div>
					<div class="ibox-content">
						<div class="gridStyle" ui-grid="calendar" ui-grid-pagination ui-grid-selection ui-grid-resize-columns ui-grid-pinning></div>
					</div>


				</div>
			</div>


	</form>

	<form class="form-horizontal" id="imPortPushManagerFromExcelForm" name="horizontalImport" novalidate>
		<div id="imPortPushManagerFromExcel" class="modal fade" tabindex="-1" role="dialog">
			<div class="modal-dialog" style="width: 900px">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal">
							&times;</button>
						<h3 class="modal-title">推送id:{{importPushId}} 导入商户信息</h3>
					</div>
					<div class="modal-body">
						<div class="form-group">
							<label class="col-sm-2 control-label">导入文件：<i class="red_req">注意：导入文件会将上次上传的商户信息删除</i></label>
							<div class="col-sm-3 checkbox ">
								<input type="file" nv-file-select="" ng-model="fileSelect" uploader="uploader" multiple/>
								<table class="table">
									<tbody>
									<tr ng-repeat="item in uploader.queue">
										<td>
											<strong>{{ item.file.name }}</strong>
										</td>
										<td nowrap>
											<button type="button" class="btn btn-danger btn-xs" ng-click="item.remove()">
												<span class="glyphicon glyphicon-trash"></span>删除
											</button>
										</td>
									</tr>
									</tbody>
								</table>
							</div>
							<label class="col-sm-2 control-label"></label>
							<div class="col-sm-3 checkbox ">
								<a href="pushManager/downloadMerchantNoTemplate" >下载商户模板文件</a>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label"></label>
							<div class="col-sm-6">
								<button class="btn btn-primary btn-mr20" type="button" ng-click='importCommit()'
												id="btnSubmitImport" ng-disabled="uploader.queue.length==0||submitting">提交</button>
								<button class="btn btn-primary8" type="button" ng-click='cancel()'
								>取消</button>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</form>

	<form class="form-horizontal" id="previewPushManagerForm" name="horizontalPreview" novalidate>
		<div id="previewPushManager" class="modal fade" tabindex="-1" role="dialog">
			<div class="modal-dialog" style="width: 900px">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal">
							&times;</button>
						<h3 class="modal-title">导入商户</h3>
					</div>
					<div class="modal-body">
						<div class="form-group">
							<label class="col-sm-2 control-label">推送标题：</label>
							<div class="col-sm-4">
								<input type="text" class="form-control" name="pushTitle" ng-model="previewBaseInfo.pushTitle" disabled >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label"><i class="red_req">*</i>推送内容：</label>
							<div class="col-sm-4">
								<textarea rows="10" class="form-control"  name="pushContent" style="min-width: 350px;" cols="30" ng-model="previewBaseInfo.pushContent" disabled></textarea>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label">跳转链接：</label>
							<div class="col-sm-4">
								<input type="text" class="form-control" name="jumpUrl" ng-model="previewBaseInfo.jumpUrl" disabled>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label">预览商户号：</label>
							<div class="col-sm-4">
								<input type="text" class="form-control" name="previewMerchantNo" ng-model="previewBaseInfo.previewMerchantNo" >
							</div>
							<div class="req_mesg" ng-show="horizontalPreview.previewMerchantNo.$dirty && horizontalPreview.previewMerchantNo.$invalid">
								<span ng-show="horizontalPreview.previewMerchantNo.$error.required">预览商户号不能为空</span>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label"></label>
							<div class="col-sm-6">
								<button class="btn btn-primary btn-mr20" ng-disabled="horizontalPreview.$invalid || submitting" type="button" ng-click='commitPreview()'
												id="btnSubmitPreview" >提交预览</button>
								<button class="btn btn-primary8" type="button" ng-click='cancelPreview()'
								>关闭</button>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</form>
</div>
